package com.etc.service.impl;

import com.etc.dao.CollectionDao;
import com.etc.dao.impl.CollectionDaoImpl;
import com.etc.entity.Collection;
import com.etc.service.CollectionService;

public class CollectionServiceImpl implements CollectionService{
	private CollectionDao collectionDao = new CollectionDaoImpl();
	/**
	 * 添加一条收藏记录
	 */
	@Override
	public boolean addCollection(Integer customerId, Integer gamesId) {
		
		return collectionDao.add(customerId, gamesId) > 0;
	}
	/**
	 * 查询单个收藏
	 */
	@Override
	public Collection findCollectionByCustomerIdAndGamesId(Integer customerId, Integer gamesId) {
		
		return collectionDao.findByCustomerIdAndGamesId(customerId, gamesId);
	}
	/**
	 * 删除单个收藏
	 */
	@Override
	public boolean deleteCollectionByCustomerIdAndGamesId(Integer customerId, Integer gamesId) {
	
		return collectionDao.deleteByCustomerIdAndGamesId(customerId, gamesId) > 0;
	}

}
